package com.rk.kbk.controller;

import com.rk.kbk.common.JsonResp;
import com.rk.kbk.dao.AdminCatalogDao;
import com.rk.kbk.model.AdminCatalog;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by bilibili on 2017/3/31.
 */

@CrossOrigin
@RestController
@Transactional
@RequestMapping(value="/api/adminCatalog")
public class AdminCatalogController {
    private Logger log = Logger.getLogger(this.getClass());
    @Autowired
    private AdminCatalogDao adminCatalogDao;



    /**
     * @获取权限列表
     * @param
     * @return 返回值JsonResp
     */
    @RequestMapping(value = "/getCatalog",
            method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_VALUE + ";charset=UTF-8")
    public JsonResp getCatalog() {
        log.debug("批量删除管理员(永久)");
        List<AdminCatalog> adminCatalogList = adminCatalogDao.findByStatusAndParentIdIsNull(1);
        return JsonResp.ok(adminCatalogList);
    }









}





